package no.rmz.chez.game.moveSelection;

import java.util.Collection;


public final class FirstSelector<T> extends Selector<T> {
    
    
    public FirstSelector() {
        super();
    }
    
    
    /**
     * Get the first element.
     * @param possibilities The possible return values.
     * @return The first element.
     */
    @Override
    public  T selectFrom(Collection<T> possibilities){
    	if (possibilities.isEmpty()) {
    		return null;
    	} else {
    		return  possibilities.iterator().next();
    	}
    }
}
